﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x0200044A RID: 1098
	[DisallowMultipleComponent]
	public class ObservableUpdateSelectedTrigger : ObservableTriggerBase, IEventSystemHandler, IUpdateSelectedHandler
	{
		// Token: 0x06001772 RID: 6002 RVA: 0x00063D53 File Offset: 0x00062153
		void IUpdateSelectedHandler.OnUpdateSelected(BaseEventData eventData)
		{
			if (this.onUpdateSelected != null)
			{
				this.onUpdateSelected.OnNext(eventData);
			}
		}

		// Token: 0x06001773 RID: 6003 RVA: 0x00063D6C File Offset: 0x0006216C
		public IObservable<BaseEventData> OnUpdateSelectedAsObservable()
		{
			Subject<BaseEventData> result;
			if ((result = this.onUpdateSelected) == null)
			{
				result = (this.onUpdateSelected = new Subject<BaseEventData>());
			}
			return result;
		}

		// Token: 0x06001774 RID: 6004 RVA: 0x00063D94 File Offset: 0x00062194
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onUpdateSelected != null)
			{
				this.onUpdateSelected.OnCompleted();
			}
		}

		// Token: 0x04000CDE RID: 3294
		private Subject<BaseEventData> onUpdateSelected;
	}
}
